<?php

require './vendor/autoload.php';

$config = array(
    "es_hosts" => "192.168.166.35:9200",
);

//defaultLogge是一个快捷的方法；你也可以自己通过Monolog来创建自己的logger;
//$logger = \Elasticsearch\ClientBuilder::defaultLogger("./logs/test.log");
$logger = new \Monolog\Logger("test");
$logger->pushHandler(new \Monolog\Handler\StreamHandler("./logs/test.log", \Monolog\Logger::WARNING));
$esClient = \Elasticsearch\ClientBuilder::create()
    ->setHosts(array($config['es_hosts']))
    ->setLogger($logger)
    ->build();

$params = array(
    'index' => 'fkl_ceshi',
    'type' => 'test_type',
    "id" => "8d83fe48449a2b2758a02441cb4c5fb4",
);
$esClient->delete($params);
